/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Server.domain;

/**
 *
 * @author Ripper
 */
public class Plain 
{
    private double x;
    private double y;
    
    private Tile[][] tileGrid;
    
    public Plain(int a, int b, int xx, int yy)
    {
        tileGrid = new Tile[a][b];
        x = xx;
        y = yy;
    }
    
    public void setTileAt(int a, int b, Tile t)
    {
        tileGrid[a][b] = t;
    }
    public Tile getTileAt(int a, int b)
    {
        return tileGrid[a][b];
    }
    public double getX()
    {
        return x;
    }
    public double getY()
    {
        return y;
    }
    public String getNecessaryInformation()
    {
        String data = "";
        
        data += "x:"+getX()+",y:"+getY()+",n:"+tileGrid.length+",m:"+tileGrid[0].length+",size:"+Tile.TILE_WORLD_SIZE+",[";
        
        for(int a = 0; a < tileGrid.length;a++)
        {
            data += "(";
            for(int b = 0; b < tileGrid[a].length;b++)
            {
                Tile t = tileGrid[a][b];
                
                data += "" + t.getTileLookId();
                
                data += "-";
            }
            data += ")";
        }
        
        data += "]";
        
        return data;
    }
}
